SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO


CREATE PROCEDURE dbo.[DnnProduct_GetFileById]
	@FileId int	
AS
BEGIN
	SELECT FileId,
		   folders.PortalId,
		   [FileName],
		   Extension,
		   Size,
		   Width,
		   Height,
		   ContentType,
		   files.FolderID,
		   FolderPath AS 'Folder',
		   StorageLocation,
		   IsCached,
		   SHA1Hash,
		   FolderMappingID,
		   LastModificationTime
	FROM dbo.[DnnProduct_Files] AS files
	INNER JOIN dbo.[DnnProduct_Folders] AS folders ON files.FolderID = folders.FolderID
	WHERE FileId = @FileId
END

GO
